package nl.scalasim.ui

import nl.scalasim.{Setting, Controller}

/**
 * Models a single level. Provides methods to obtain references to the
 * control actors of the current level. 
 *
 * @author Yigal Duppen
 * @since Nov 7, 2010
 */
class Level(val setting: Setting) {

  private var _controller: Controller = new Controller(setting)
  _controller.start()

  def controller_=(c: Controller) = {
    _controller.quit()
    _controller = c
    _controller.start()
  }

  def controller = _controller
  def choreographer = _controller.addressBook.choreographer
  def historian = _controller.addressBook.historian

}